// 引入i18n国际化插件
import Vue from 'vue';
import VueI18n from 'vue-i18n';
import { getLangType} from '@/static/js/sign.js'

import eleEnLocale from 'element-ui/lib/locale/lang/en'
import eleZhLocale from 'element-ui/lib/locale/lang/zh-CN'

import enLocale from './en';
import zhLocale from './zh';

console.log(eleZhLocale)

Vue.use(VueI18n);
 
// 注册i18n实例并引入语言文件，文件格式等下解析
const i18n = new VueI18n({
    locale: getLangType() || 'zh-CN',
    messages: {
		'zh-CN': {
			...eleZhLocale,
			...zhLocale,
		},
		'en-US': {
			...eleEnLocale,
			...enLocale
		},
    }
});

export default i18n;